﻿using System.Windows;
using System.Windows.Controls;
using SUMO.MediaBrowser.Foundation;
using SUMO.MediaBrowser.ViewModel;

namespace SUMO.MediaBrowser.Controls
{
    public partial class LoginWindow : ChildWindow
    {
        public LoginWindow()
        {
            InitializeComponent();
        }

        public OpsContext ViewModel
        {
            get
            {
                return DataContext as OpsContext;
            }
            set
            {
                DataContext = value;
            }
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            //OpsContext.Current.ServiceBase = ServiceBaseUrl.Text;
            //OpsContext.Current.Username = Username.Text;
            //OpsContext.Current.Password = Password.Password;
            this.Close();
            //this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            //this.DialogResult = false;
            //MessageBox.Show(ViewModel.ServiceUrl);
        }

        public static LoginWindow Current
        {
            get 
            {
                var singleLoginView = Singleton<LoginWindow>.Instance; 
                //singleLoginView.ViewModel = OpsContext.Current;
                return singleLoginView;
            }
        }
    }
}


